#include "Shm.hpp"
#include "namedPipe.hpp"
#include <unistd.h>

int main()
{
    // 1. 创建共享内存
    Shm shm(pathname,gproj_id,gUser);
    shm.Zero();
    char *shmaddr = (char*)shm.Addr();

    // 2. 打开管道
    NamePipe pipe(comm_path,User);
    pipe.OpenForWrite();
    
    sleep(3);
    // write
    char ch = 'A';
    while(ch <= 'Z')
    {
        shmaddr[ch - 'A'] = ch;
        ch++;

        std::string temp="wakeup";
        pipe.WritePipe(temp);
        sleep(2);
    }

    sleep(5);
 

    return 0;
}